local skel = fk.CreateSkill{--定义
  name = "kpaI__puji",
  tags = { Skill.Compulsory },--锁定技标签
}

Fk:loadTranslationTable{--翻译
  ["kpaI__puji"] = "仆继",
  [":kpaI__puji"] = "锁定技，你于不同的体力值下使用的<a href=':kpaI__puji_read2'>牌</a>与发动的<a href=':kpaI__puji_read'>武将牌上的技能</a>独立计算次数。当你于出牌阶段使用【杀】的次数耗尽后，你回复1点体力。",
  [":kpaI__puji_read"] = "特指“订血”和“天义”。",
  [":kpaI__puji_read2"] = "特指所有【杀】和【酒】。",
  ["@kpaI__pujikpaI__tianyi-phase"] = "天义：",
  ["@kpaI__pujikpaI__dingxue"] = "订血：",

  ["$kpaI__puji1"] = "万骨成阶擎天意，谁继？四弟太史季！",
  ["$kpaI__puji2"] = "锋指乾坤昼作夜，谁书？三弟太史叔！",
  ["$kpaI__puji3"] = "戮世独夫天地窄，谁众？二弟太史仲！",
  ["$kpaI__puji4"] = "一夫刃下万言喑，谁驳？长兄太史伯！",
  ["$kpaI__puji5"] = "我当要替天行道！",
}

skel:addEffect(fk.CardUsing,{
  mute = true,
  can_refresh = function(self, event, target, player, data)
    return target == player and player:hasSkill(skel.name, true) and
    (data.card.trueName == "slash" or data.card.trueName == "analeptic")
  end,
  on_refresh = function (self, event, target, player, data)
    local room = player.room
    local card = data.card
    player:addMark(skel.name..card.trueName..player.hp.."-phase",1)
  end,
})

skel:addEffect(fk.HpChanged,{
  mute = true,
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(skel.name, true)
  end,
  on_use = function (self, event, target, player, data)
    player.room:notifySkillInvoked(player, skel.name)
    local iiii = math.max(1,math.min(player.hp,5))
    player:broadcastSkillInvoke(skel.name,iiii)
    if not table.contains(player:getTableMark("@"..skel.name.."kpaI__dingxue"),tostring(player.hp))
    and player:hasSkill("kpaI__dingxue") then
      player:setSkillUseHistory("kpaI__dingxue",0,Player.HistoryGame)
    end
    if not table.contains(player:getTableMark("@"..skel.name.."kpaI__tianyi-phase"),tostring(player.hp))
    and player:hasSkill("kpaI__tianyi") then
      player:setSkillUseHistory("kpaI__tianyi",0,Player.HistoryPhase)
    end
    local number = player:getMark(skel.name.."slash"..player.hp.."-phase") or 0
    player:setCardUseHistory("slash",number,Player.HistoryPhase)
    local number2 = player:getMark(skel.name.."analeptic"..player.hp.."-phase") or 0
    player:setCardUseHistory("analeptic",number2,Player.HistoryPhase)
  end,
})

skel:addEffect(fk.CardUseFinished,{
  mute = true,
  can_trigger = function (self, event, target, player, data)
    return target == player and player:hasSkill(skel.name) and data.card.trueName == "slash" and player.room:getCurrent() == player
    and not player:canUse(Fk:cloneCard("slash"))
  end,
  on_use = function (self, event, target, player, data)
    player.room:recover({
      who = player,
      num = 1,
      skillName = skel.name,
    })
  end,
})

return skel